<?php
/**
 * Created by PhpStorm.
 * User: gesangdianzi
 * Date: 2017/12/24
 * Time: 20:01
 */
use frontend\components\GoLinkPager;
use common\utils\Com;

$this->title = $cat['title'];
$keyword = $cat['keyword'];
$description = $cat["info"];
?>
<?php $this->beginBlock('keyword'); ?>
<meta name="Keywords" content="<?=$keyword?>" />
<meta name="Description" content="<?=$description?>" />
<?php $this->endBlock(); ?>
<div class="cat-list">
    <div class="w-1200">
        <div class="content">

            <?php if(!empty($list)):?>
                <?php foreach ($list as $item) :?>
                    <div class="item">
                        <div class="time">
                            <div class="day"><i class="pic"></i><?=date("m-d",$item['created_at'])?></div>
                            <div class="year"><?=date("Y",$item['created_at'])?></div>
                        </div>
                        <div class="data">
                            <div class="title"><a href="<?=Com::urlNews($item['id'])?>"><?=$item['title']?></a></div>
                            <div class="txt">
                                <?=!empty($item['info']) ? $item['info'] :mb_substr(strip_tags($item['txt']['text']),0,90,'utf-8');?>
                            </div>
                        </div>
                        <a href="<?=Com::urlNews($item['id'])?>" class="more">查看更多</a>
                    </div>
                <?php endforeach;?>
            <?php endif;?>
            <div class="page">
                <?= GoLinkPager::widget([
                    'pagination' => $pages,
                    'lastPageLabel' => ">>",
                    'firstPageLabel' => "<<",
                    'prevPageLabel' => "<",
                    'nextPageLabel' => ">",
                    'reUrl' => "reUrlNews",
                ]); ?>
            </div>
        </div>
    </div>
</div>
<?=$this->render("@app/views/layouts/right")?>